<template>
    <div class="info-tool">
        <div class="little-helper">
            <div class="head" v-if="['2', '3'].includes(clientModel)">
                <el-input placeholder="请输入内容" v-model="keyword" class="input-with-btn">
                    <el-button slot="append" @click="searchBAH">质控</el-button>
                </el-input>
            </div>
            <div class="drg-content" v-if="showDRGInfo">
                <el-collapse v-model="activeCollapse" accordion v-if="JSON.stringify(infoData.DRGsData) !== '{}' && infoData.DRGsData">
                    <el-collapse-item name="1">
                        <template slot="title">付费方式：{{infoData.YLFKFS}} {{checkCodeText('ylfkfs', infoData.YLFKFS)}}<br/>DRG分组：{{infoData.DRGsData.code}}</template>
                        <p>DRG名称：{{infoData.DRGsData.name}}
                            <span v-if="!isEdit" class="refresh-btn" @click="refreshDRG()"><svg-icon icon-class="refresh"/>重试</span>
                        </p>
                        <p>DRG权重：{{infoData.DRGsData.weight}}</p>
                        <p class="income">预计盈亏：
                            <span style="margin-right: 20px">{{infoData.DRGsData.drgIncome | getMoneyNum}}元</span>
                            高低倍率：<span :class="infoData.DRGsData.lowMagnification ? 'span-blue':'span-red'" v-if="infoData.DRGsData.lowMagnification || infoData.DRGsData.highMagnification">
                                {{infoData.DRGsData.lowMagnification || infoData.DRGsData.highMagnification}}
                                {{infoData.DRGsData.lowMagnification ? '低' : '高'}}
                                <i :class="infoData.DRGsData.lowMagnification ? 'el-icon-bottom':'el-icon-top'"/>
                            </span>
                            <span v-else>正常</span>
                        </p>
                    </el-collapse-item>
                </el-collapse>
                <el-collapse v-model="activeCollapse" accordion v-else>
                    <el-collapse-item name="1">
                        <template slot="title">DRG分组：</template>
                        <p>DRG名称：
                            <span class="refresh-btn" @click="refreshDRG()"><svg-icon icon-class="refresh"/>重试</span>
                        </p>
                        <p>DRG权重：</p>
                        <p class="income">预计盈亏：
                            <span>元</span>
                        </p>
                    </el-collapse-item>
                </el-collapse>
            </div>
            <el-radio-group v-model="tabsType">
                <el-radio-button label="质控信息">{{getTabsTitle('qc')}}</el-radio-button>
                <el-radio-button label="医嘱查漏">医嘱查漏</el-radio-button>
                <el-radio-button label="ICD查询">ICD查询</el-radio-button>
            </el-radio-group>
            <div v-if="tabsType === '质控信息' && infoData.medicalRecordID">
                <div class="scroe" v-if="userType === '2'">
                    <div>
                        <p><span>{{infoData.nationScore || 0}}</span>分</p>
                        <p>国标得分</p>
                    </div>
                    <div>
                        <p><span>{{-infoData.hospitalScore || 0}}</span>分</p>
                        <p>院标扣分</p>
                    </div>
                    <el-button v-if="!isEdit && isLast && showIgnoreBtn" type="text" class="edit" icon="el-icon-edit" v-auth="{code: 100003000003}" @click="showScoreTable"></el-button>
                </div>
                <div class="helper-content">
                    <el-tabs v-model="activeHelper" stretch>
                        <el-tab-pane :label="getTabsTitle('coding')" name="coding">
                            <div class="scroll-box">
                                <el-row class="scroll-row-title">
                                    <el-col :span="24"><span class="block"></span>强制缺陷(<span class="span">{{infoData.codingError.length}}</span>)
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row" v-for="(item, index) in infoData.codingError" :key="'forced' + index">
                                    <el-col :span="18">
                                        {{item.fieldName}}：{{item.content}}
                                    </el-col>
                                    <el-col :span="4" v-if="item.nationDeduction > 0">
                                        <span class="score-row">{{-item.nationDeduction}}分</span>
                                    </el-col>
                                    <el-col :span="24">
                                        提示：
                                        <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'forcedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                            <span class="normal" :key="'forcedTips' + i" v-else>{{it}};</span>
                                        </template>
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row-title">
                                    <el-col :span="24"><span class="block doubt"></span>疑似缺陷(<span class="span doubt">{{infoData.codingWaring.length}}</span>)
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row" v-for="(item, index) in infoData.codingWaring" :key="'suspected' + index">
                                    <el-col :span="18">
                                        {{item.fieldName}}：{{item.content}}
                                    </el-col>
                                    <el-col :span="4" v-if="item.nationDeduction > 0">
                                        <span class="score-row">{{-item.nationDeduction}}分</span>
                                    </el-col>
                                    <el-col :span="24">
                                        提示：
                                        <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'suspectedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                            <span class="normal" :key="'suspectedTips' + i" v-else>{{it}};</span>
                                        </template>
                                    </el-col>
                                    <el-col :span="2" :offset="19" v-if="!item.isIgnored">
                                        <el-button v-if="!isEdit && showIgnoreBtn" class="ignore" size="mini" type="primary" plain @click="ignore(item.id, 'coding')">
                                            忽略
                                        </el-button>
                                    </el-col>
                                    <el-col :span="10" :offset="14" v-else-if="item.isIgnored">
                                        <el-row>
                                            <el-col class="ignored" :span="10">
                                                <span>已忽略</span>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-button v-if="!isEdit && showIgnoreBtn" size="mini" plain type="warning" @click="cancelIgnore(item.id, 'coding')">
                                                    取消忽略
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-col>
                                </el-row>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane :label="getTabsTitle('notCoding')" name="notCoding">
                            <div class="scroll-box">
                                <el-row class="scroll-row-title">
                                    <el-col :span="24"><span class="block"></span>强制缺陷(<span class="span">{{infoData.noneCodingError.length}}</span>)
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row" v-for="(item, index) in infoData.noneCodingError" :key="'notForced' + index">
                                    <el-col :span="18">
                                        {{item.fieldName}}：{{item.content}}
                                    </el-col>
                                    <el-col :span="4" v-if="item.nationDeduction > 0">
                                        <span class="score-row">{{-item.nationDeduction}}分</span>
                                    </el-col>
                                    <el-col :span="24">
                                        提示：
                                        <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'notForcedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                            <span class="normal" :key="'notForcedTips' + i" v-else>{{it}};</span>
                                        </template>
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row-title">
                                    <el-col :span="24"><span class="block doubt"></span>疑似缺陷(<span class="span doubt">{{infoData.noneCodingWaring.length}}</span>)
                                    </el-col>
                                </el-row>
                                <el-row class="scroll-row" v-for="(item, index) in infoData.noneCodingWaring" :key="'notSuspected' + index">
                                    <el-col :span="18">
                                        {{item.fieldName}}：{{item.content}}
                                    </el-col>
                                    <el-col :span="4" v-if="item.nationDeduction > 0">
                                        <span class="score-row">{{-item.nationDeduction}}分</span>
                                    </el-col>
                                    <el-col :span="24">
                                        提示：
                                        <template v-for="(it, i) in item.msg">
                                        <span class="normal" :key="'notSuspectedTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                            <span class="normal" :key="'notSuspectedTips' + i" v-else>{{it}};</span>
                                        </template>
                                    </el-col>
                                    <el-col :span="2" :offset="19" v-if="!item.isIgnored">
                                        <el-button v-if="!isEdit && showIgnoreBtn" class="ignore" size="mini" type="primary" plain @click="ignore(item.id, 'notCoding')">
                                            忽略
                                        </el-button>
                                    </el-col>
                                    <el-col :span="10" :offset="14" v-else-if="item.isIgnored">
                                        <el-row>
                                            <el-col class="ignored" :span="10">
                                                <span>已忽略</span>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-button v-if="!isEdit && showIgnoreBtn" size="mini" plain type="warning" @click="cancelIgnore(item.id, 'notCoding')">
                                                    取消忽略
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-col>
                                </el-row>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane :label="getTabsTitle('score')" name="score">
                            <div class="scroll-box">
                                <el-row class="scroll-row" v-for="(item, index) in infoData.allDeduction" :key="'score' + index">
                                    <el-col :span="18">
                                        {{item.fieldName}}：{{item.content}}
                                    </el-col>
                                    <el-col :span="4">
                                        <span class="score-row">{{-item.nationDeduction}}分</span>
                                    </el-col>
                                    <el-col :span="24">
                                        提示：
                                        <template v-for="(it,i) in item.msg">
                                        <span class="normal" :key="'scoreTips' + i" v-if="item.msg.length > 1">
                                            {{i + 1}}.{{it}};<br/>
                                        </span>
                                            <span class="normal" :key="'scoreTips' + i" v-else>{{it}};</span>
                                        </template>
                                    </el-col>
                                </el-row>
                            </div>
                        </el-tab-pane>
                    </el-tabs>
                </div>
            </div>
            <div class="icd-content" v-if="tabsType === 'ICD查询'">
                <div class="results-page">
                    <div class="res-head">
                        <div class="btn-group">
                            <el-radio-group v-model="searchICD.typeYB" class="radio-icd-box radio-icd-box1">
                                <el-radio-button label="国临版2.0"></el-radio-button>
                                <el-radio-button label="医保版1.0"></el-radio-button>
                            </el-radio-group>
                            <el-radio-group v-model="searchICD.type"class="radio-icd-box radio-icd-box2" >
                                <el-radio label="ICD-10">ICD-10</el-radio>
                                <el-radio label="ICD-9-CM-3">ICD-9-CM-3</el-radio>
                            </el-radio-group>
                        </div>
                        <el-input placeholder="请输入疾病名称/编码" v-model="searchICD.word" clearable @keyup.enter.native="submitSearchICD(1)" class="input-with-button">
                            <el-button slot="append" icon="el-icon-search" @click="submitSearchICD(1)">搜索</el-button>
                        </el-input>
                        <el-row class="res-select" v-show="searchICD.type !== 'ICD-10'">
                            <el-col :span="12">
                                <span>类别</span>
                                <el-select v-model="searchICD.category" @change="submitSearchICD(1)" class="res-category">
                                    <el-option key="1" label="全部" value="all"></el-option>
                                    <el-option key="2" label="手术" value="手术"></el-option>
                                    <el-option key="3" label="治疗性操作" value="治疗性操作"></el-option>
                                    <el-option key="4" label="诊断性操作" value="诊断性操作"></el-option>
                                    <el-option key="5" label="介入治疗" value="介入治疗"></el-option>
                                </el-select>
                            </el-col>
                            <el-col :span="12">
                                <span>录入选项</span>
                                <el-select v-model="searchICD.selectivity" @change="submitSearchICD(1)" class="res-selectivity">
                                    <el-option key="6" label="全部" value="all"></el-option>
                                    <el-option key="7" label="必选" value="必选"></el-option>
                                    <el-option key="8" label="选择性" value="选择性"></el-option>
                                    <el-option key="9" label="中医必选" value="中医必选"></el-option>
                                </el-select>
                            </el-col>
                        </el-row>
                    </div>
                    <div class="content-res-icd" :class="searchICD.type !== 'ICD-10' ? 'short' : ''" v-show="ICDTotal > 0">
                        <el-row type="flex" justify="space-between" v-for="(item, index) in ICDRes" class="content-row" :key="index">
                            <el-col :span="15" class="name">
                                {{item.diseaseName || item.name}}
                            </el-col>
                            <el-col :span="8" class="code">
                                {{item.fullCode || item.code}}
                            </el-col>
                            <el-col class="type" :span="24" v-show="searchICD.type !== 'ICD-10'">
                                <span>类别：{{item.type}}</span><span>录入选项：{{item.selectivity}}</span>
                            </el-col>
                        </el-row>
                    </div>
                    <p v-show="ICDTotal <= 0">抱歉！没有找到符合限定条件的记录。</p>
                    <pagination class="content-pag" v-show="ICDTotal > 0" :isSmall="true" :layout="'total, prev, pager, next'" :total="ICDTotal" :page.sync="currentPageICD" :limit.sync="ICDPageSize"
                                @pagination="submitSearchICD"/>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {searchMRList, searchMR} from '@/api/search'
    import {ignoreData,
        cancelIgnoreData,
        saveFeedback,
        getScoreList,
        getScoreNum,
        submitScoreNum,
        searchICD10,
        searchICD10YB,
        searchICD9,
        searchICD9YB,
        submitFeedbackMR,
        reDRGSingle} from '@/api/info-tool'
    import {previewData, sumbitPreviewData} from '@/api/info-table'
    import {getMoneyNum, dateNumFormat} from '@/utils/filters'
    import nameCoding from '@/assets/json/nameCoding.json'
    import Pagination from '@/components/Pagination'

    export default {
        name: 'helper',
        data () {
            return {
                // 显示小助手
                showLittleHelper: true,
                // 小助手当前标签
                activeHelper: 'coding',
                // 显示意见反馈弹框
                isShowFeedback: false,
                // 显示临床反馈弹框
                isShowMRFeedback: false,
                // 类型选项
                typeOptions: [
                    {'key': 1, 'value': '编码问题'},
                    {'key': 2, 'value': '非编码问题'},
                    {'key': 3, 'value': '评分问题'},
                    {'key': 4, 'value': '统计问题'},
                    {'key': 5, 'value': '其他问题'}
                ],
                // 意见反馈表单
                feedbackForm: {
                    feedbackKind: '',
                    content: ''
                },
                // 临床反馈表单
                MRFeedbackForm: {
                    content: ''
                },
                // buffer列表
                bufferArr: [],
                // 图片列表
                imgList: [],
                // 预览图片路径
                dialogImageUrl: '',
                // 显示预览图片
                dialogImgVisible: false,
                // 评分弹框显示标签页
                activeNameTable: 'index',
                // 显示评分弹框
                isShowScore: false,
                // 评分类型
                scoreType: '1',
                // 评分列表数据
                scoreData: [],
                // 所有的扣分，项包括自动扣分项
                detailIdItem: [],
                // 国标得分
                nationalScore: 0,
                // 院标得分
                hospitalScore: 0,
                // 医院扣分
                hospitalDeduction: 0,
                // 评分获取的所有数据
                allScoreData: [],
                // 显示ICD查询
                showICD: false,
                // ICD查询内容
                searchICD: {
                    typeYB: '国临版2.0',
                    type: 'ICD-10',
                    word: '',
                    category: '',
                    selectivity: ''
                },
                // 显示ICD查询结果/查询页面
                showICDSearchRes: false,
                // ICD查询数据
                ICDRes: [],
                // ICD数据总数
                ICDTotal: 0,
                // ICD单页数量
                ICDPageSize: 50,
                // ICD当前页
                currentPageICD: 1,
                // 默认展开DRG
                activeCollapse: '1',
                userType: '',
                // 显示drg信息
                showDRGInfo: false,
                // 计时器
                timer: null,
                rules: {
                    feedbackKind: [
                        {required: true, message: '请选择反馈类型', trigger: 'change'}
                    ],
                    content: [
                        {required: true, message: '请输入反馈内容', trigger: ['blur', 'change']}
                    ]
                },
                // 搜索病案
                keyword: '',
                tabsType: '质控信息',
                infoData: {
                    noneCodingError: [],
                    noneCodingWaring: [],
                    codingError: [],
                    codingWaring: [],
                    allDeduction: [],
                    DRGsData: {},
                    resExamine: []
                },
                // 是否显示忽略按钮
                showIgnoreBtn: false,
                saveQuality: {},
                saveGroup: {},
                saveData: {},
                scoreMedicalRecordID: '',
                // 显示搜索框
                clientModel: ''
            }
        },
        computed: {
            isEdit () {
                return this.$store.state.user.isEdit
            },
            isLast () {
                return true
            }
        },
        created () {
            this.clientModel = localStorage.getItem('clientModel')
            this.userType = localStorage.getItem('userType').toString()
            if (localStorage.getItem('cloudMode') === 'false') {
                this.showDRGInfo = JSON.parse(localStorage.getItem('rolesCode')).includes(200000000000) && JSON.parse(localStorage.getItem('hasSystems')).includes('MRDRG')
            }
            this.showDRGInfo = JSON.parse(localStorage.getItem('rolesCode')).includes(200000000000)
        },
        mounted () {
            this.timer = setInterval(this.collapseDrg, 10)
            window.initPage = (data) => {
                this.infoData = JSON.parse(data)
            }
            window.changeShowIgnoreBtn = (data) => {
                this.showIgnoreBtn = Boolean(Number(data))
            }
            window.scoreId = (data) => {
                this.scoreMedicalRecordID = data
            }
            window.searchMRQC = (data) => {
                this.getQCData(JSON.parse(data).WT4, JSON.parse(data).RequestId)
            }
            window.returnSearch = (data) => {
                this.infoData.allDeduction = JSON.parse(data).data
                this.infoData.nationScore = JSON.parse(data).score.gbTotalScore
                this.infoData.hospitalScore = JSON.parse(data).score.yyTotalScore
            }
        },
        methods: {
            /**
             * 搜索小助手
             */
            searchBAH () {
                let params = {
                    kind: 1,
                    keyword: this.keyword
                }
                /* eslint-disable */
                if (native.getConfig().adapterServer) {
                /* eslint-enable */
                    searchMRList(params).then(res => {
                        if (res.length) {
                            this.getMRTable(res[0].id)
                        } else {
                            this.$message.error('当前病案号不存在，请重新输入')
                        }
                    })
                }
            },
            /**
             * 获取病案首页
             */
            getMRTable (id) {
                let params = {
                    id
                }
                searchMR(params).then(res => {
                    let obj = {}
                    Object.keys(res).forEach(key => {
                        obj[key.toUpperCase()] = res[key]
                    })
                    let infoData = {
                        ...obj,
                        noneCodingError: [],
                        noneCodingWaring: [],
                        codingError: [],
                        codingWaring: [],
                        allDeduction: [],
                        DRGsData: {},
                        resExamine: []
                    }
                    infoData.ZKKB = infoData.ZKKB ? infoData.ZKKB.split(',') : infoData.ZKKB
                    infoData.CSRQ = dateNumFormat(infoData.CSRQ)
                    infoData.RYSJ = dateNumFormat(infoData.RYSJ)
                    infoData.CYSJ = dateNumFormat(infoData.CYSJ)
                    infoData.ZKRQ = dateNumFormat(infoData.ZKRQ)
                    infoData.SSJCZRQ1 = dateNumFormat(infoData.SSJCZRQ1)
                    infoData.SSJCZRQ2 = dateNumFormat(infoData.SSJCZRQ2)
                    infoData.SSJCZRQ3 = dateNumFormat(infoData.SSJCZRQ3)
                    infoData.SSJCZRQ4 = dateNumFormat(infoData.SSJCZRQ4)
                    infoData.SSJCZRQ5 = dateNumFormat(infoData.SSJCZRQ5)
                    infoData.SSJCZRQ6 = dateNumFormat(infoData.SSJCZRQ6)
                    infoData.SSJCZRQ7 = dateNumFormat(infoData.SSJCZRQ7)
                    this.getQCData(infoData)
                })
            },
            /**
             * 获取质控信息
             */
            getQCData (infoData, id) {
                let params = {
                    ...infoData,
                    orgId: this.getLocalStorage('userMechanism', 'id'),
                    medicalRecordID: '00000000-0000-0000-0000-000000000000'
                }
                Object.keys(params).forEach(key => {
                    params[key] = params[key] === null ? '' : params[key]
                })
                if (!id) {
                    delete params.noneCodingError
                    delete params.noneCodingWaring
                    delete params.codingError
                    delete params.codingWaring
                    delete params.allDeduction
                    delete params.idList
                    delete params.DRGsData
                    delete params.status
                    delete params.index
                    delete params.count
                    delete params.nationScore
                    delete params.coding
                    delete params.noneCoding
                    delete params.packageID
                    delete params.hospitalTime
                    params.CSRQ = this.dateToString(params.CSRQ)
                    params.RYSJ = this.dateToString(params.RYSJ)
                    params.CYSJ = this.dateToString(params.CYSJ)
                    params.ZKRQ = this.dateToString(params.ZKRQ)
                    params.SSJCZRQ1 = this.dateToString(params.SSJCZRQ1)
                    params.SSJCZRQ2 = this.dateToString(params.SSJCZRQ2)
                    params.SSJCZRQ3 = this.dateToString(params.SSJCZRQ3)
                    params.SSJCZRQ4 = this.dateToString(params.SSJCZRQ4)
                    params.SSJCZRQ5 = this.dateToString(params.SSJCZRQ5)
                    params.SSJCZRQ6 = this.dateToString(params.SSJCZRQ6)
                    params.SSJCZRQ7 = this.dateToString(params.SSJCZRQ7)
                    params.RYSJS = params.RYSJS.toString()
                    params.CYSJS = params.CYSJS.toString()
                    params.ZKKB = params.ZKKB ? params.ZKKB.join(',') : params.ZKKB
                }
                previewData(params).then(res => {
                    if (res.code.toString() === '200') {
                        let data = {
                            ...res.data.reQualityModel.qcDetail,
                            DRGsData: res.data.reGroupModel.drgDetail,
                            hospitalTime: Number(infoData.ZYCS),
                            medicalRecordSign: infoData.BAH
                        }
                        this.saveQuality = res.data.reQualityModel.saveQuality
                        this.saveGroup = res.data.reGroupModel.saveGroup
                        this.saveData = params
                        this.infoData = {...data, ...params}
                        if (['1', '3'].includes(this.clientModel)) {
                            /* eslint-disable */
                            native.invoke('EditorWindow', 'initPage', JSON.stringify({...data, ...params}))
                            /* eslint-enable */
                        }
                        this.sumbitEdit()
                        let arr = []
                        this.infoData.codingError.forEach(item => {
                            arr.push({
                                kind: 0,
                                level: 1,
                                fieId: item.field,
                                errors: item.msg
                            })
                        })
                        this.infoData.codingWaring.forEach(item => {
                            arr.push({
                                kind: 0,
                                level: 2,
                                fieId: item.field,
                                errors: item.msg
                            })
                        })
                        this.infoData.noneCodingError.forEach(item => {
                            arr.push({
                                kind: 1,
                                level: 1,
                                fieId: item.field,
                                errors: item.msg
                            })
                        })
                        this.infoData.noneCodingWaring.forEach(item => {
                            arr.push({
                                kind: 1,
                                level: 2,
                                field: item.field,
                                errors: item.msg
                            })
                        })
                        if (id) {
                            /* eslint-disable */
                            native.onRequestComplete(id, true, JSON.stringify(arr))
                            /* eslint-enable */
                        }
                    } else {
                        if (id) {
                            /* eslint-disable */
                            native.onRequestComplete(id, false, null)
                            /* eslint-enable */
                        }
                    }
                }).catch(() => {
                    if (id) {
                        /* eslint-disable */
                        native.onRequestComplete(id, false, null)
                        /* eslint-enable */
                    }
                })
            },
            /**
             * 提交编辑
             */
            sumbitEdit () {
                let params = {
                    saveQuality: this.saveQuality,
                    saveGroup: this.saveGroup,
                    saveData: this.saveData
                }
                sumbitPreviewData(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.scoreMedicalRecordID = res.data
                        this.showIgnoreBtn = true
                        this.saveQuality = {}
                        this.saveGroup = {}
                        this.saveData = {}
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 日期格式纯数字
             * @param val 日期格式
             */
            dateToString (val) {
                if (val !== '') {
                    return val.replace(/-/g, '')
                }
                return val
            },
            /**
             * 显示隐藏小助手
             */
            showLittleHelperPop () {
                this.showLittleHelper = !this.showLittleHelper
            },
            /**
             * 获取小助手数据
             */
            getHelperData () {
                this.nationalScore = this.infoData.nationScore
                this.hospitalScore = this.infoData.hospitalScore
                this.hospitalDeduction = this.infoData.deduction
            },
            /**
             * 获取标签页名称
             * @param name 标签名
             */
            getTabsTitle (name) {
                switch (name) {
                case 'score':
                    return this.infoData.nationScore ? `扣分(${this.infoData.nationScore - 100})分` : '扣分(0分)'
                case 'coding':
                    return this.infoData.coding ? `编码缺陷(${this.infoData.coding})处` : '编码缺陷(0)处'
                case 'notCoding':
                    return this.infoData.noneCoding ? `非编码缺陷(${this.infoData.noneCoding})处` : '非编码缺陷(0)处'
                case 'qc':
                    return `质控信息(${(Number(this.infoData.coding) || 0) + (Number(this.infoData.noneCoding || 0))})`
                }
            },
            /**
             * 忽略
             * @param id 数据id
             * @param name 数据类型
             */
            ignore (id, name) {
                let params = {id}
                ignoreData(params).then(res => {
                    if (res.code.toString() === '200') {
                        if (name === 'coding') {
                            for (let i = 0; i < this.infoData.codingWaring.length; i++) {
                                if (this.infoData.codingWaring[i].id === id) {
                                    this.infoData.codingWaring[i].isIgnored = true
                                    break
                                }
                            }
                        } else if (name === 'notCoding') {
                            for (let i = 0; i < this.infoData.noneCodingWaring.length; i++) {
                                if (this.infoData.noneCodingWaring[i].id === id) {
                                    this.infoData.noneCodingWaring[i].isIgnored = true
                                    break
                                }
                            }
                        }
                        this.$message.success('忽略成功!')
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 取消忽略
             * @param id 数据id
             * @param name 数据类型
             */
            cancelIgnore (id, name) {
                let params = {id}
                cancelIgnoreData(params).then(res => {
                    if (res.code.toString() === '200') {
                        if (name === 'coding') {
                            for (let i = 0; i < this.infoData.codingWaring.length; i++) {
                                if (this.infoData.codingWaring[i].id === id) {
                                    this.infoData.codingWaring[i].isIgnored = false
                                    break
                                }
                            }
                        } else if (name === 'notCoding') {
                            for (let i = 0; i < this.infoData.noneCodingWaring.length; i++) {
                                if (this.infoData.noneCodingWaring[i].id === id) {
                                    this.infoData.noneCodingWaring[i].isIgnored = false
                                    break
                                }
                            }
                        }
                        this.$emit('changeInfoData', this.infoData)
                        this.$message.success('成功取消忽略!')
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 打开意见反馈弹框
             */
            showDialogFeedback () {
                this.isShowFeedback = true
            },
            /**
             * 关闭意见反馈弹框
             */
            closeDialogFeedback () {
                this.$refs['feedbackForm'].resetFields()
                this.isShowFeedback = false
            },
            /**
             * 提交意见反馈表单
             */
            submitFeedback () {
                this.$refs['feedbackForm'].validate((valid) => {
                    if (valid) {
                        let params = this.feedbackForm
                        saveFeedback(params).then(res => {
                            if (res.code.toString() === '200') {
                                this.$message.success('提交意见反馈成功!')
                                this.closeDialogFeedback()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        return false
                    }
                })
            },
            /**
             * 打开临床反馈弹框
             */
            showDialogMRFeedback () {
                this.isShowMRFeedback = true
                this.MRFeedbackForm.content = ''
            },
            /**
             * 关闭临床反馈弹框
             */
            closeDialogMRFeedback () {
                this.imgList = []
                this.bufferArr = []
                this.$refs.upload.clearFiles()
                this.$refs['feedbackMRForm'].resetFields()
                this.isShowMRFeedback = false
            },
            /**
             * 提交临床反馈
             */
            submitMRFeedback () {
                this.$refs['feedbackMRForm'].validate((valid) => {
                    if (valid) {
                        let params = {
                            receiverName: this.infoData.ZYYS,
                            bah: this.infoData.BAH,
                            zycs: this.infoData.ZYCS,
                            content: this.MRFeedbackForm.content,
                            images: []
                        }
                        this.imgList.forEach((item, index) => {
                            params.images.push({
                                sort: index + 1,
                                name: item.name,
                                buffers: this.bufferArr[index]
                            })
                        })
                        submitFeedbackMR(params).then(res => {
                            if (res.code.toString() === '200') {
                                this.$message.success('提交临床反馈成功!')
                                this.closeDialogMRFeedback()
                            } else {
                                this.$message.error(res.message)
                            }
                        })
                    } else {
                        return false
                    }
                })
            },
            /**
             * 文件上传成功
             */
            handleChange (file) {
                if (file.status === 'ready') {
                    this.imgList.push(file)
                    this.imageProcessing(file.raw).then(res => {
                        this.bufferArr.push(res)
                    })
                }
            },
            /**
             * 预览图片
             * @param file 文件对象
             */
            handlePictureCardPreview (file) {
                this.dialogImageUrl = file.url
                this.dialogImgVisible = true
            },
            /**
             * 移除图片
             */
            handleRemove (file, fileList) {
                this.imgList = fileList
            },
            /**
             * 图片转换
             * @param file 文件对象
             */
            imageProcessing (file) {
                let _this = this
                return new Promise(function (resolve) {
                    let reader = new FileReader()
                    reader.readAsArrayBuffer(file)
                    reader.onload = function () {
                        resolve(_this.buf2hex(reader.result))
                    }
                })
            },
            /**
             * buffer数组转byte
             * @param buffer buffer数组
             */
            buf2hex (buffer) {
                return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('')
            },
            /**
             * 图片上传前
             */
            beforeUpload (file) {
                let isLt10M = file.size / 1024 / 1024 < 10
                if (!isLt10M) {
                    this.$message.error('图片大小不能超过 10MB!')
                }
                return isLt10M
            },
            /**
             * 打开评分弹框
             */
            showScoreTable () {
                let data = {
                    hospitalTime: Number(this.infoData.hospitalTime),
                    medicalRecordSign: this.infoData.medicalRecordSign,
                    medicalRecordID: this.scoreMedicalRecordID
                }
                localStorage.setItem('scoreData', JSON.stringify(data))
                /* eslint-disable */
                nativeAsync.open({
                    title: '质控评分',
                    name: 'ScoreWindow',
                    url: `${window.location.origin}/client/score`,
                    resizeMode: 3,
                    width: 1280,
                    height: 800,
                    modal: true
                })
                /* eslint-enable */
            },
            /**
             * 打开得分列表获取数据
             */
            getScoreTableData () {
                let params = {
                    medicalRecordSign: this.infoData.medicalRecordSign,
                    hospitalTime: Number(this.infoData.hospitalTime),
                    isLast: this.isLast,
                    orgId: this.getLocalStorage('userMechanism', 'id')
                }
                this.isShowScore = true
                this.hospitalScore = 0
                getScoreList(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.scoreType = '1'
                        this.allScoreData = res.data
                        this.detailIdItem = []
                        this.allScoreData.forEach(item => {
                            if (item.deduction > 0 && item.isDeduction) {
                                this.detailIdItem.push({
                                    field: item.field,
                                    reason: item.reason,
                                    scoreType: item.scoreType
                                })
                            }
                        })
                        this.getScore()
                        this.changeScoreType()
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 关闭评分弹框
             */
            closeDialogScore () {
                this.isShowScore = false
            },
            /**
             * 修改评分类型
             */
            changeScoreType () {
                this.scoreData = []
                switch (this.scoreType) {
                case '1':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 1) { this.scoreData.push(item) }
                    })
                    break
                case '2':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 2) { this.scoreData.push(item) }
                    })
                    break
                case '3':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 3) { this.scoreData.push(item) }
                    })
                    break
                case '4':
                    this.allScoreData.forEach(item => {
                        if (item.messageType === 4) { this.scoreData.push(item) }
                    })
                    break
                }
            },
            /**
             * 修改评分
             * @param row 行数据
             * @param type 修改方式select是0分
             */
            changeScore (row, type) {
                let index = 0
                if (!row.isDeduction && this.detailIdItem.length > 0) {
                    for (let i = 0; i < this.detailIdItem.length; i++) {
                        if (this.detailIdItem[i].field === row.field && this.detailIdItem[i].scoreType === row.scoreType) {
                            index = i
                            break
                        }
                    }
                    if (index >= 0) {
                        this.detailIdItem.splice(index, 1)
                        this.getScore()
                    }
                    row.deduction = 0
                } else {
                    if (this.detailIdItem.length >= 0) {
                        for (let i = 0; i < this.detailIdItem.length; i++) {
                            if (this.detailIdItem[i].field === row.field && this.detailIdItem[i].scoreType === row.scoreType) {
                                index = i
                                break
                            }
                        }
                        if (this.detailIdItem.length > 0 &&
                            this.detailIdItem[index].field === row.field && this.detailIdItem[index].scoreType === row.scoreType) {
                            this.detailIdItem[index].reason = row.reason
                            return
                        } else {
                            this.detailIdItem.push({
                                field: row.field,
                                reason: row.reason,
                                scoreType: row.scoreType
                            })
                        }
                        this.getScore()
                        row.deduction = type ? 0 : row.scoreValue
                    }
                }
            },
            /**
             * 计算分数
             */
            getScore () {
                let params = {
                    detailId: this.infoData.medicalRecordID,
                    items: this.detailIdItem,
                    orgId: this.getLocalStorage('userMechanism', 'id')
                }
                getScoreNum(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.hospitalScore = res.data.yyTotalScore
                        this.nationalScore = res.data.gbTotalScore
                        this.hospitalDeduction = res.data.deduction
                    } else {
                        this.$message.error(res.message)
                    }
                })
            },
            /**
             * 提交修改评分
             */
            submitScore () {
                let flag = true
                for (let i = 0; i < this.detailIdItem.length; i++) {
                    if (!this.detailIdItem[i].reason) {
                        this.$message.error('扣分原因不能为空!')
                        flag = false
                        break
                    }
                }
                if (flag) {
                    let params = {
                        detailId: this.infoData.medicalRecordID,
                        items: this.detailIdItem,
                        orgId: this.getLocalStorage('userMechanism', 'id'),
                        dischargeDate: this.infoData.dischargeDate || this.parseTime(new Date().getTime())
                    }
                    submitScoreNum(params).then(res => {
                        if (res.code.toString() === '200') {
                            this.$message.success('提交评分成功!')
                            this.closeDialogScore()
                            this.$emit('getData', this.infoData.medicalRecordID)
                        } else {
                            this.$message.error(res.message)
                        }
                    }).catch(() => {
                        this.$message.error('提交失败!')
                    })
                }
            },
            /**
             * 查询ICD
             * @param page 指定页数/重新输入查询
             */
            submitSearchICD (page) {
                let params = {
                    keyWord: this.searchICD.word,
                    pageCount: this.ICDPageSize,
                    pageIndex: typeof page === 'object' ? page.page : page
                }
                if (this.searchICD.typeYB === '国临版2.0') {
                    if (this.searchICD.type === 'ICD-10') {
                        searchICD10(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                        })
                    } else {
                        params.type = this.searchICD.category === 'all' ? '' : this.searchICD.category
                        params.selectivity = this.searchICD.selectivity === 'all' ? '' : this.searchICD.selectivity
                        searchICD9(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                        })
                    }
                } else {
                    if (this.searchICD.type === 'ICD-10') {
                        params.pageSize = params.pageCount
                        searchICD10YB(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                        })
                    } else {
                        params.type = this.searchICD.category === 'all' ? '' : this.searchICD.category
                        params.selectivity = this.searchICD.selectivity === 'all' ? '' : this.searchICD.selectivity
                        params.pageSize = params.pageCount
                        searchICD9YB(params).then(res => {
                            this.ICDRes = res.data.rows
                            this.ICDTotal = Number(res.data.total)
                            this.showICDSearchRes = true
                        })
                    }
                }
            },
            /**
             * 获取信息类型
             * @param val 类型值
             */
            getScoreType (val) {
                switch (val.toString()) {
                case '1':
                    return '患者基本信息'
                case '2':
                    return '住院过程信息'
                case '3':
                    return '诊疗信息'
                case '4':
                    return '费用信息'
                }
            },
            /**
             * 获取信息类别
             * @param val 类别值
             */
            getScoreClass (val) {
                switch (val.toString()) {
                case '1':
                    return 'A类'
                case '2':
                    return 'B类'
                case '3':
                    return 'C类'
                case '4':
                    return 'D类'
                }
            },
            /**
             * 打开关闭drg信息
             */
            collapseDrg () {
                let DRGHeight = this.showDRGInfo ? document.getElementsByClassName('drg-content')[0].offsetHeight : 0
                let allHeight = document.getElementsByClassName('little-helper')[0].offsetHeight
                let maxHeight = ''
                if (this.userType === '2') {
                    if (['2', '3'].includes(this.clientModel)) {
                        maxHeight = allHeight - 38 - DRGHeight - 20 - 28 - 63 - 55 - 10 + 'px'
                    } else {
                        maxHeight = allHeight - DRGHeight - 20 - 28 - 63 - 55 - 10 + 'px'
                    }
                } else {
                    if (['2', '3'].includes(this.clientModel)) {
                        maxHeight = allHeight - 38 - DRGHeight - 20 - 28 - 55 - 10 + 'px'
                    } else {
                        maxHeight = allHeight - DRGHeight - 20 - 28 - 55 - 10 + 'px'
                    }
                }
                if (document.getElementsByClassName('scroll-box').length) {
                    document.getElementsByClassName('scroll-box')[0].style.maxHeight = maxHeight
                    document.getElementsByClassName('scroll-box')[1].style.maxHeight = maxHeight
                    document.getElementsByClassName('scroll-box')[2].style.maxHeight = maxHeight
                } else if (document.getElementsByClassName('content-res-icd').length) {
                    if (this.searchICD.type === 'ICD-10') {
                        if (['2', '3'].includes(this.clientModel)) {
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = allHeight - 38 - DRGHeight - 20 - 28 - 75 - 28 - 36 - 10 + 'px'
                        } else {
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = allHeight - DRGHeight - 20 - 28 - 75 - 28 - 36 - 10 + 'px'
                        }
                    } else {
                        if (['2', '3'].includes(this.clientModel)) {
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = allHeight - 38 - DRGHeight - 20 - 28 - 75 - 28 - 36 - 10 - 40 + 'px'
                        } else {
                            document.getElementsByClassName('content-res-icd')[0].style.maxHeight = allHeight - DRGHeight - 20 - 28 - 75 - 28 - 36 - 10 - 40 + 'px'
                        }
                    }
                }
            },
            /**
             * 重试DRG
             */
            refreshDRG () {
                let params = {
                    medicalRecordSign: this.infoData.medicalRecordSign,
                    hospitalTime: Number(this.infoData.hospitalTime),
                    isLast: this.isLast,
                    orgId: this.getLocalStorage('userMechanism', 'id')
                }
                reDRGSingle(params).then(res => {
                    if (res.code.toString() === '200') {
                        this.infoData.DRGsData = res.data
                    }
                })
            },
            /**
             * 获取需转码数据
             * @param code 类型值
             * @param val 数据参数
             */
            checkCodeText (code, val) {
                if (code === 'bjks' && val) {
                    let valArr = val.split(',')
                    let res = ''
                    valArr.forEach(item => {
                        res += nameCoding[code] ? nameCoding[code][item] || item : item
                        res += ','
                    })
                    res = res.substring(0, res.length - 1)
                    return res
                } else {
                    return nameCoding[code] ? nameCoding[code][val] || val : val
                }
            }
        },
        filters: {
            getMoneyNum
        },
        components: {
            Pagination
        },
        beforeDestroy () {
            clearInterval(this.timer)
        }
    }
</script>

<style scoped lang="scss">
    .little-helper, .searchICD {
        background: #fff;
        color: #333;
        /*width: 350px;*/
        height: 100vh;
        line-height: 22px;
        font-size: 14px;
        overflow: hidden;
        border: 1px solid #dcdcdc;
        border-radius: 4px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        .head {
            height: 38px;
            display:flex;
            justify-content: flex-start;
            align-items: center;
            padding: 5px;
            >>>.el-input__inner {
                border-color: #4E6EF2;
            }
            >>>.el-input-group__append {
                background: #4E6EF2;
                border-color: #4E6EF2;
                color: #fff;
            }
        }
        &.small {
            height: 38px;
        }
        >>>.el-radio-group {
            width: 100%;
            text-align: center;
            .el-radio-button__inner {
                width: calc(30vw);
            }
        }
        .scroe {
            position: relative;
            margin-bottom: 10px;
            margin-top: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-left: 10%;
            div {
                margin-right: 10px;
                &:nth-child(1) {
                    margin-right: 20px;
                }
                &:nth-child(2) {
                    span {
                        color: #F59A23;
                    }
                }
                p {
                    font-size: 14px;
                    text-align: center;
                    margin: 0;
                    line-height: 20px;
                    span {
                        font-size: 24px;
                        font-weight: 600;
                        color: #409eff;
                    }
                }
            }
            .edit {
                /*position: absolute;*/
                /*left: 240px;*/
                /*top: 1px;*/
                width: 40px;
                font-size: 16px;
            }
            .icd {
                position: absolute;
                left: 300px;
                top: 13px;
                font-size: 12px;
                line-height: 12px;
                padding: 2px;
                border-radius: 4px;
                color: #409eff;
                border: 1px solid #409eff;
                cursor: pointer;
            }
        }
        .helper-content {
            padding: 0 5px;
            .scroll-box {
                height: auto;
                max-height: 262px;
                overflow-y: auto;
                &::-webkit-scrollbar {
                    width: 8px;
                    height: 1px;
                }
                &::-webkit-scrollbar-thumb {
                    border-radius: 10px;
                    -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                    background-color: #7f7d7d;
                }
                &::-webkit-scrollbar-track {
                    border-radius: 8px;
                    -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                    background-color: #f7f0f0;
                }
                .scroll-row {
                    padding: 0 4px;
                    background: #f2f2f2;
                    font-weight: 600;
                    margin-bottom: 6px;
                    line-height: 18px;
                    .score-row {
                        width: 100%;
                        display: block;
                        color: #e21f06;
                        text-align: right;
                    }
                }
                .scroll-row-title {
                    padding: 0 4px;
                    font-weight: 600;
                    margin-bottom: 6px;
                    line-height: 18px;
                    .block {
                        display: inline-block;
                        width: 4px;
                        height: 12px;
                        background: #ec3434;
                        border-radius: 2px;
                        margin-right: 4px;
                        &.doubt {
                            background: #ec7534;
                        }
                    }
                    .span {
                        color: #ec3434;
                        &.doubt {
                            color: #ec7534;
                        }
                    }
                }
                .ignored {
                    padding-top: 5px;
                    span {
                        color: #e6a23c;
                    }
                }
            }
        }
        .icd-content {
            .results-page {
                padding: 0 5px;
                .res-head {
                    .title {
                        margin: 0 0 10px 0;
                        line-height: 22px;
                        .toback {
                            font-size: 18px;
                            margin-top: 2px;
                            cursor: pointer;
                        }
                    }
                    .res-select {
                        margin-top: 10px;
                        .res-category {
                            width: 114px;
                        }
                        .res-selectivity {
                            width: 100px;
                        }
                    }
                    .btn-group {
                        .radio-icd-box1 {
                            margin: 10px 0;
                            >>>.el-radio-button__inner {
                                width: calc(20vw);
                            }
                        }
                        .radio-icd-box2 {
                            margin-bottom: 10px;
                            .el-radio {
                            }
                        }
                    }
                    .input-with-button {
                        >>>.el-input__inner {
                            border-color: #4E6EF2;
                        }
                        >>>.el-input-group__append {
                            background: #4E6EF2;
                            border-color: #4E6EF2;
                            color: #fff;
                        }
                    }
                }
                .content-res-icd {
                    margin-top: 5px;
                    height: auto;
                    max-height: 360px;
                    overflow-y: auto;
                    &.short {
                        max-height: 318px;
                    }
                    &::-webkit-scrollbar {
                        width: 10px;
                        height: 1px;
                    }
                    &::-webkit-scrollbar-thumb {
                        border-radius: 10px;
                        -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                        background-color: #7f7d7d;
                    }
                    &::-webkit-scrollbar-track {
                        border-radius: 8px;
                        -webkit-box-shadow: inset 0 0 5px rgb(204, 204, 204);
                        background-color: #f7f0f0;
                    }
                    .content-row {
                        padding: 2px 0;
                        border-bottom: 1px solid #eee;
                        flex-wrap: wrap;
                        &:last-child {
                        }
                        .name, .code {
                            font-size: 14px;
                            font-weight: 600;
                        }
                        .code {
                            box-sizing: border-box;
                            padding-right: 8px;
                            word-break: break-all;
                        }
                        .type {
                            margin: 0;
                            span:first-child {
                                margin-right: 10px;
                            }
                        }
                    }
                }
                .content-pag {
                    margin-top: 10px;
                    padding: 0;
                    >>>.pagination {
                        text-align: center;
                        .el-pagination__total {
                            font-size: 12px;
                        }
                    }
                }
            }
        }
        .feedback {
            width: 100%;
            position: absolute;
            bottom: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #fff;
            &.between {
                padding: 0 5px;
                justify-content: space-between;
            }
        }
    }
    .searchICD {
        right: 364px;
    }
    >>>.el-tabs__item {
        padding: 0 6px;
    }
    .dialog-footer {
        text-align: center;
    }
    .drg-content {
        margin: 10px;
        padding: 10px;
        background: #F5F6FA;
        border-radius: 4px;
        >>>.el-collapse {
            border: 0;
            .el-collapse-item {
                .el-collapse-item__header {
                    background: #F5F6FA;
                    line-height: 18px;
                    height: auto;
                    border: 0;
                }
                .el-collapse-item__content {
                    background: #F5F6FA;
                    padding-bottom: 0;
                    p {
                        line-height: 18px;
                        margin: 0;
                    }
                }
                .el-collapse-item__wrap {
                    border: 0;
                }
            }
            .income {
                span {
                    .el-icon-top {
                        color: #ee3934;
                    }
                    .el-icon-bottom {
                        color: #1682e6;
                    }
                    &.span-blue {
                        color: #1682e6;
                    }
                    &.span-red {
                        color: #ee3934;
                    }
                }
            }
        }
        .refresh-btn {
            margin-left: 6px;
            font-size: 13px;
            color: #1682e6;
            height: 18px;
            cursor: pointer;
            white-space: nowrap;
            svg {
                width: 14px;
                height: 14px;
                margin-bottom: -2px;
            }
        }
    }
</style>
<style lang="scss">
    .score-dialog {
        width: 80%;
        margin-top: 8vh!important;
        .el-dialog__title {
            font-weight: 600;
        }
        .el-dialog__body {
            padding: 15px 20px 20px;
        }
        .el-radio-group {
            width: 100%;
            text-align: right;
        }
        .score-table {
            .rating-items {
                width: 6px;
                height: 12px;
                display: inline-block;
                vertical-align: middle;
                margin: 0;
                border-radius: 2px;
                &.blue {
                    background: #1297dc;
                }
                &.yellow {
                    background: #f29716;
                }
            }
        }
        .dialog-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            .footer-score-box {
                width: 50%;
                p {
                    margin: 0;
                    font-weight: 500;
                }
                span:first-child {
                    font-size: 24px;
                }
                .national {
                    color: #66a0f2;
                }
                .hospital {
                    color: #ff8100;
                }
                .deduction {
                    color: #e21f06;
                }
            }
        }
    }
    .normal {
        font-weight: normal;
    }
    .upload-img {
        max-height: 159px;
        overflow: hidden;
        &.none {
            & > .el-upload.el-upload--picture-card {
                display: none;
            }
        }
    }
</style>
